
App({
  onLaunch() {
    console.log('App onLaunch')
  },
  onShow() {
    console.log('App onShow')
    // this.http()
  },
  onHide() {
    console.log('App onHide')
  },
  http({method = 'GET', url, data}) {
    return new Promise((resolve, reject) => {
      wx.request({
        method,
        url: `http://localhost:3000${url}`,
        data,
        success(res) {
          resolve(res)
        },
        fail(e) {
          reject(e)
        }
      })
    })
  },
  globalData: {
    userinfo: {
      name: '张三',
      phone: '13299880077'
    }
  }
})
